import request from '@/utils/request.js'

// 文章列表
export const getNewsAPI = params => request( {
	url: '/post',
	params
} )

// 文章详情
export const getArticleAPI = id => request( {
	url: '/post/' + id,
} )

// 评论列表
export const getCommentAPI = id => request( {
	url: '/post_comment/' + id
} )

// 发布文章
export const publishPostAPI = data => request( {
	method: 'post',
	url: '/post',
	data
} )

// 修改文章
export const editArticleAPI = ( id, data ) => request( {
	method: 'post',
	url: '/post_update/' + id,
	data
} )
